package com.zhishu.snatch.system.util;

import java.util.LinkedList;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

@Configuration
public class Const {

	@Autowired
	private Environment environment;

	public static final String SESSION_USER = "sessionUser";

	public static int QUEUE_NUM;
	public static int THREAD_NUM;

	public static int FIAL_400 = 400;
	public static int FIAL_500 = 500;
	public static int FIAL = 999;
	public static int SUC = 200;
	public static String PORTAL_HOST;
	public static String PHANTOMJS_PATH;
	public static String MQ_HOST;

	public static LinkedList<Integer> POINT = new LinkedList<>();
	public static final Object LOCK_OBJ = new Object();

	public static String THINKDATA_ID = "__thinkdata_id";
	public static String TYPE_LIST = "list";
	public static String TYPE_ELE = "element";

	@PostConstruct
	public void doStart() {
		Const.QUEUE_NUM = environment.getProperty("queue_num", Integer.class);
		Const.THREAD_NUM = environment.getProperty("thread_num", Integer.class);
		Const.PORTAL_HOST = environment.getProperty("portal.host");
		Const.PHANTOMJS_PATH = environment.getProperty("phantomjs_path");
		Const.MQ_HOST = environment.getProperty("mp.host");
		
	}
}
